<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.father {
				width: 200px;
				height: 200px;
				background-color: red;
				position: absolute;
				left: 50%;
				top: 50%;
				margin-left: -100px;
				margin-top: -100px;
			}
			/* 这种兼容性好，但是必须知道元素的宽高 */
		</style>
	</head>
	<body>
		<div class="father">
		
		</div>
	</body>
</html>

